from app import db
from tools.image import ImageDefault


class Blog(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    uid = db.Column(db.Integer, nullable=False)
    sort = db.Column(db.String(50), default='交友')
    title = db.Column(db.String(120), nullable=False)
    content = db.Column(db.Text, nullable=False)
    image = db.Column(db.Text, default=lambda :ImageDefault())
    published = db.Column(db.Boolean, default=False)
    checked = db.Column(db.Boolean, default=False)
    passed = db.Column(db.Boolean, default=False)
    reason = db.Column(db.String(300), default='无')